import { Controller, Get, Inject, Query } from '@midwayjs/core';
import { NovelService } from '../../service/novel.service';
import { R } from '../common/vo/Result';

@Controller('/admin/novel')
export class NovelController {
    @Inject()
    novelService :NovelService;
   
    @Get('/all')
    async getAll(): Promise<R<any>> {
      let novals = await this.novelService.findNovel()
      return new R(0,"hello my novel",novals);
    }

    @Get('/')
    async getNovelById(@Query('id') id: string): Promise<R<any>> {
      let novals = await this.novelService.findNovel()
      return new R(0,"hello my novel",novals);
    }
}